package core;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class DateCalendar {

	/**
	 * @param args
	 */
	private ArrayList<String> monthList = new ArrayList<String>();
	private ArrayList<String> date;
	private int year = 0;
	private int month = 0;

	public int getYear() {
		return year;
	}

	public void setDate(int month_, int year_){
		this.month = month_;
		this.year = year_;
		date.set(0, monthList.get(month));
		date.set(1, "" + year);
	}
	
	public int getMonth() {
		return month;
	}

	public String getMonth(int i) {
		return monthList.get(i);
	};

	public DateCalendar(int month_, int year_) {
		monthList.add("January");
		monthList.add("February");
		monthList.add("March");
		monthList.add("April");
		monthList.add("May");
		monthList.add("June");
		monthList.add("July");
		monthList.add("August");
		monthList.add("September");
		monthList.add("October");
		monthList.add("November");
		monthList.add("December");

		date = new ArrayList<String>();

		month = month_;
		year = year_;
		date.add(monthList.get(month));
		date.add(Integer.toString(year));
	}

	public List<String> getNext() {
		if (++month == 12) {
			year++;
			month = 0;
		}
		date.set(0, monthList.get(month));
		date.set(1, Integer.toString(year));
		return date;
	}

	public List<String> getPrevious() {
		if (--month == -1) {
			year--;
			month = 11;
		}
		date.set(0, monthList.get(month));
		date.set(1, Integer.toString(year));
		return date;
	}

	public ArrayList<String> getDate() {
		return date;
	}

	public void setDate(ArrayList<String> date) {
		this.date = date;
	}

}
